/**
 * 冒泡排序
 */

public class BobolSort {
    public static void boboSort() {
        int[] list = {1, 2, 5, 33, 2, 9, 11, 89};
        for (int i = 0; i < list.length - 1; i++) {
            for (int j = 0; j < list.length - i - 1; j++) {
                if (list[j] > list[j + 1]) {
                    int tmp = list[j];
                    list[j] = list[j + 1];
                    list[j + 1] = tmp;
                }
            }

        }

        for (int i = 0; i < list.length; i++) {
            System.out.println(list[i]);
        }
    }

    public static void main(String[] args) {
        boboSort();
    }


}
